package com.example.aicooking.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.aicooking.entity.UserRelation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserRelationMapper extends BaseMapper<UserRelation> {
    @Select("SELECT COUNT(*) FROM user_relations WHERE user_id = #{userId} AND status = 1")
    Integer countFollowers(@Param("userId") Long userId);
}
